package org.example.hansp.reflection.obtainc_class_structure_information;

import org.junit.jupiter.api.Test;


import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class FieldAPI {
    Class personCLass=Class.forName("org.example.hansp.reflection.obtainc_class_structure_information.Person");

    public FieldAPI() throws ClassNotFoundException {
    }

    @Test
    public void test() {
        Field[] fields = personCLass.getDeclaredFields();
        for (Field field : fields) {
            System.out.println(field.getModifiers());
            System.out.println("返回该属性类型对应的类的class对象"+field.getType());
        }
    }

}
